home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17323 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  85 lines

  1. Newsgroups: comp.lang.c++
  2. Path: cs.vu.nl!mlassche
  3. From: mlassche@cs.vu.nl (Lassche MA)
  4. Subject: Simple Question seeks simple answer
  5. Nntp-Posting-Host: galjoen.cs.vu.nl
  6. Sender: news@cs.vu.nl
  7. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  8. Date: Mon, 15 Apr 1996 10:19:29 GMT
  9. X-Newsreader: TIN [version 1.2 PL2]
  10. Message-ID: <DpwFCI.xu.0.-s@cs.vu.nl>
  11.  
  12. I'm skipping from 16bit to 32bit, there are some minor problems which I 
  13. cannot solve nor does the 'whelp cguide'.
  14.  
  15. In 16 bits it was common practice to do the well known string copy
  16. something like
  17.     mov es,x
  18.     mov di,y
  19.     mov cx,z
  20.     mov es:[di],x1
  21.     rep movsd.
  22.  
  23. When I tried something similair in 32 bits my watcom compiler complained
  24. that 'es' was an 'illegal register' (very strange since it is mentioned in
  25. the cguide). 'Well' I thought 'Why use es at all we now have an 'EDI'.' But
  26. this resulted in something not quite right.
  27. the code was I think
  28.     #pragma aux Fill_Screen_White = \
  29.         "MOV EDI,0A0000H"       \
  30.         "MOV CX,16000"          \ 
  31.         "MOV [EDI],15"          \
  32.         "REP MOVSD"             \
  33.         modify [ EDI CX ];
  34.  
  35. Question [(1)] how to do a string copy 32 bits - wise ?
  36.  
  37. Something which looks the same.
  38.  
  39. To get the VESA info you've got to call int 10H with arguments AH  = 4fh
  40. and AL = 00H and ES:DI being the pointer to put the junk. Once more
  41. how's this done in 32 bit. 
  42.  
  43. I've tried a non asm approach. The usual SREGS, REGS call.
  44.  
  45.  
  46. 16 bit version, tested and worked.
  47.  
  48. struct Vesa_info    
  49.     {
  50.         bla...bla...bla
  51.     }
  52.  
  53. Vesa_info V;
  54. union REGS Registers;
  55. struct SREGS Segment_Registers;
  56.  
  57. Registers.w.ax = 4f00h;
  58. Registers.w.di = FP_OFF(&V);
  59. Segment_Registers.es = FP_SEG(&V);
  60.  
  61. int86x(10H, &Registers, &Registers, &Segment_Registers);
  62.  
  63. For the 32 bit version I invented the same code exept int86x = int386x.
  64.  
  65. This resulted in either the subtle crash of my p5 or a total empty Vesa_info
  66. struct ( my video card supports Vesa - the 16 bit version proved that ).
  67.  
  68. Any bright ideas people ?
  69.  
  70.  
  71. Finaly does anyone know a optimize-em-up site, that is some basic optimization
  72. tricks for assembly code ?
  73.  
  74.  
  75. Please reply to my email.
  76.  
  77. Regards,
  78.     MArk
  79.  
  80. mlassche@cs.vu.nl
  81.  
  82. Keywords: 
  83.  
  84.  
  85.